from rest_framework import serializers

from one.models import Type, Company


class TypeSerializer(serializers.ModelSerializer):
    class Meta:
        model = Type
        fields = '__all__'
class CompanySerializer(serializers.ModelSerializer):
    type = TypeSerializer(read_only= True)
    type_id = serializers.IntegerField(write_only= True)
    class Meta:
        model = Company
        fields = '__all__'